package Meituan.Feature;

import com.google.common.base.Splitter;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * @author: leiwenkang
 * @date: 2020/4/24
 * @time: 19:42
 */
public class FeatureGenConstant {
    public static void main(String[] args) {
        String str = "mt_ups_mt_age:-70000.0\n" +
                "mt_ups_mt_gender:-70000.0\n" +
                "mt_ups_mt_is_student:-70000.0\n" +
                "mt_ups_mt_is_white_collar:-70000.0\n" +
                "mt_ups_mt_edu_level:-70000.0\n" +
                "mt_ups_mt_salary_level:-70000.0\n" +
                "mt_ups_mt_marital_status:-70000.0\n" +
                "mt_ups_mt_have_child:-70000.0\n" +
                "mt_ups_mt_consume_style:-70000.0\n" +
                "mt_ups_latent_prob:-70000.0\n" +
                "mt_ups_sensi_score:-70000.0\n" +
                "mt_ups_mt_daozong_score:-70000.0\n" +
                "mt_ups_mt_hotel_score:-70000.0\n" +
                "mt_ups_mt_maoyan_score:-70000.0\n" +
                "mt_ups_mt_waimai_score:-70000.0\n" +
                "mt_ups_mt_ups_mt_daocan_score:-70000.0\n" +
                "mt_ups_mt_waimai_p:-70000.0\n" +
                "mt_ups_mt_is_touch:-70000.0\n" +
                "mt_ups_mt_push_sensitivity_score:-70000.0\n" +
                "mt_ups_consume_waimai_level:-70000.0\n" +
                "mt_ups_consume_daocan_level:-70000.0\n" +
                "mt_ups_consume_maoyan_level:-70000.0\n" +
                "mt_ups_consume_enjoy_level:-70000.0\n" +
                "mt_ups_consume_hotel_level:-70000.0\n" +
                "mt_ups_consume_jingnei_level:-70000.0\n" +
                "mt_ups_consume_beauty_level:-70000.0\n" +
                "mt_ups_consume_traffic_level:-70000.0\n" +
                "mt_ups_consume_peisong_level:-70000.0\n" +
                "mt_ups_consume_marriage_level:-70000.0\n" +
                "mt_ups_consume_jingwai_level:-70000.0\n" +
                "mt_ups_consume_gouwu_level:-70000.0\n" +
                "mt_ups_consume_homeedu_level:-70000.0\n" +
                "mt_ups_consume_zhenguo_level:-70000.0\n" +
                "mt_ups_waimai_m_score:-70000.0\n" +
                "mt_ups_waimai_r_score:-70000.0\n" +
                "mt_ups_waimai_f_score:-70000.0\n" +
                "mt_ups_waimai_re_score:-70000.0\n" +
                "mt_ups_daocan_m_score:-70000.0\n" +
                "mt_ups_daocan_r_score:-70000.0\n" +
                "mt_ups_daocan_f_score:-70000.0\n" +
                "mt_ups_daocan_re_score:-70000.0\n" +
                "mt_ups_daozong_m_score:-70000.0\n" +
                "mt_ups_daozong_r_score:-70000.0\n" +
                "mt_ups_daozong_f_score:-70000.0\n" +
                "mt_ups_daozong_re_score:-70000.0\n" +
                "mt_ups_hotel_m_score:-70000.0\n" +
                "mt_ups_hotel_r_score:-70000.0\n" +
                "mt_ups_hotel_f_score:-70000.0\n" +
                "mt_ups_hotel_re_score:-70000.0\n" +
                "mt_ups_maoyan_m_score:-70000.0\n" +
                "mt_ups_maoyan_r_score:-70000.0\n" +
                "mt_ups_maoyan_f_score:-70000.0\n" +
                "mt_ups_maoyan_re_score:-70000.0  ";

        addSgMkt(str);
    }

    private static void addSgMkt(String str) {
        if (StringUtils.isBlank(str)) {
            return;
        }

        List<String> list = Splitter.on("\n").splitToList(str);
        for (String featureValue: list) {
            List<String> featureValueList = Splitter.on(":").splitToList(featureValue);
            String featureName = "sg_mkt_" + featureValueList.get(0).trim();

            System.out.println("public static final String " + featureName.toUpperCase() + " = \"" + featureName + "\";");
        }

    }
}
